import java.io.Serializable;

import javax.swing.ImageIcon;


public class Pipe extends draggableLabel implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Team team;
	private String orientation;
	
	public Pipe(int X, int Y, ImageIcon icon, Team team, String orientation,boolean initial) 
	{
		super(X, Y, icon,"pipe",team.getColor(),initial,20);
		this.team = team;
		this.orientation = orientation;
	}
	public String getOrientation()
	{
		return this.orientation;
	}

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}
	public boolean isPerpendicular(Pipe p)
	{
		if(this.getOrientation() == "cross")
			return true;
		else if(this.getOrientation() == "vertical" && p.getOrientation() == "horizontal")
		{
			return true;
		}
		else if(this.getOrientation() == "horizontal" && p.getOrientation() == "vertical")
		{
			return true;
		}
		else
			return false;
	}
	public boolean isPerpendicular(Road r)
	{
		if(this.getOrientation() == "vertical" && r.getOrientation() == "horizontal")
		{
			return true;
		}
		else if(this.getOrientation() == "horizontal" && r.getOrientation() == "vertical")
		{
			return true;
		}
		else
			return false;
	}

	
	
	
	
}
